
<!--
  /**************************************************
  * @ orderdetailresolvenewquery.jsp
  *
  * Copyright 2008 Shanghai Auto-Parts E-Procurement Co. Ltd
  * All Rights Reserved.
  *
  * Modify History:
  *  v1.00, 2008/01/23, wangp
  *  1) first release
  /**************************************************
-->
<%@page contentType="text/html; charset=UTF-8"%>
<%@ include file="../../common.jsp" %>
<%@ taglib uri="/page.util.gs.hitrust.com/taglibs/page" prefix="page"%>
<%@page import="system.LoginContext"%>
<%@page import="framework.core.SrvContext"%>
<html>
<head>
<title>订单拒收</title>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!--<LINK href="<%=root%>/css/css.css" type=text/css rel=stylesheet>-->
<LINK href="<%=root%>/css/caigouxitong.css"" type=text/css rel=stylesheet>
<SCRIPT language="JavaScript" src="<%=root%>/js/common.js"></SCRIPT>
<SCRIPT language="JavaScript" src="<%=root%>/js/calendar.js"></SCRIPT>
<SCRIPT language="JavaScript" src="<%=root%>/js/string.js"></SCRIPT>
<SCRIPT language="JavaScript">
     function process(val){
        if(val == 'Q'){
            var tStr = "";
            var tEnd = "";
            if(!isEmpty(ordertraceform.orderCreateDateStr.value)){
                tStr = ordertraceform.orderCreateDateStr.value.substr(0,4) + ordertraceform.orderCreateDateStr.value.substr(5,2) + ordertraceform.orderCreateDateStr.value.substr(8,2);

            }
            if(!isEmpty(ordertraceform.orderCreateDateEnd.value)){
                tEnd = ordertraceform.orderCreateDateEnd.value.substr(0,4) + ordertraceform.orderCreateDateEnd.value.substr(5,2) + ordertraceform.orderCreateDateEnd.value.substr(8,2);
            }
            if(parseInt(tStr) > parseInt(tEnd)){
                    alert("订单创建周期的开始日期不能大于截至日期！");
                    return false;
            }
            ordertraceform.action = "<%=response.encodeURL(root+"/A150902.do")%>";
            ordertraceform.submit();
        }else if(val == 'C'){
            ordertraceform.orderid.value ="";
            ordertraceform.deliverGoodsId.value="";
            ordertraceform.orderDeptId.value="0000";
            ordertraceform.orderDetailStatus.value="0000";
            ordertraceform.orderDetailStatusMx.value="";
            ordertraceform.orderCreateDateStr.value = "";
            ordertraceform.orderCreateDateEnd.value = "";
            return false;
        }
    }
</SCRIPT>
<%
        ResultProcess tOrder = (ResultProcess) request.getAttribute("order");
        ArrayList tManuf1 = (ArrayList) request.getAttribute("manufacture1");
        HashMap tMap1 = (HashMap) request.getAttribute("manufacturetyp2");
        HashMap tMap2 = (HashMap) request.getAttribute("manufacturetyp3");
        ResultProcess tGSManuf = (ResultProcess) request.getAttribute("manufacture");
        ArrayList wareList = (ArrayList)request.getAttribute("orderdept");
        ArrayList tList = new ArrayList();
        String s="";
        String sn="";
        GSProviderBean pb=(GSProviderBean)request.getAttribute("pname");
        if(pb==null){
            s=request.getParameter("providerName");
            sn=request.getParameter("proname");
        }else if(pb!=null){
            s=pb.getGs_provider_id();
            sn=pb.getGs_provider_shortname();
        }else{
            s=GSSystemConfigurator.getParam("gs.provider_SW_Id");
            sn="申沃售后服务部";
        }
      	GSOrderDAO orderDao=new GSOrderDAO();
%>
<script language="JavaScript">
var counter;
function change1(optval){
  var val = optval;
  if(val=='0'){
    var listbox = document.getElementById("manuftype2");
    listbox.length = 0;
    var option = new Option();
    option.text = "---二级---";
    option.value = "0";
    listbox.options[listbox.length] = option;
    change2(optval);
  }else{
      var counter="0";
    <%if(tMap1 !=null){
      Collection tCollection = tMap1.keySet();
      Iterator tIterator = tCollection.iterator();
      while(tIterator.hasNext()){
        String tKey = (String)tIterator.next();
        tList = (ArrayList)tMap1.get(tKey);%>
        if(val == '<%=tKey%>'){
          counter = "1";
          var listbox = document.getElementById("manuftype2");
          listbox.length = 0;
          var option = new Option();
          option.value = "0";
          option.text = "---二级---";
          listbox.options[listbox.length] = option;
          <%
                for(int n=0;n<tList.size();n++){
                    GSManufactureCategoryBean tGSManufactureBean = (GSManufactureCategoryBean)tList.get(n);
                    String categoryId = tGSManufactureBean.getGs_manufacture_category_id();
                    String categoryName = tGSManufactureBean.getGs_manufacture_category_name();%>
                    var temp1 = '<%=categoryId%>';
                    var temp2 = '<%=categoryName%>';
                    var option = new Option();
                    option.value = temp1;
                    option.text = temp2;
                    listbox.options[listbox.length] = option;
           <%
                }
           %>
            change2('0');           
         }
         
    <%
        }
    %>
        if(counter == '0'){
          var listbox = document.getElementById("manuftype2");
          listbox.length = 0;
          var option = new Option();
          option.value = "0";
          option.text = "---二级---";
          listbox.options[listbox.length] = option;  
          change2('0');     
        }
    <%  
    }
    %>
   }
}
    function change2(optval){
      var val = optval;
      if(val=='0'){
        var listbox = document.getElementById("manuftype3");
        listbox.length = 0;
        var option = new Option();
        option.text = "---三级---";
        option.value = "0";
        listbox.options[listbox.length] = option;

      }else{
        var counter = "0";
        <%if(tMap2 !=null){
          Collection tCollection = tMap2.keySet();
          Iterator tIterator = tCollection.iterator();
          while(tIterator.hasNext()){
            String tKey = (String)tIterator.next();
            tList = (ArrayList)tMap2.get(tKey);%>
            if(val == '<%=tKey%>'){
              counter = "1";
              var listbox = document.getElementById("manuftype3");
              listbox.length = 0;
              var option = new Option();
              option.text = "---三级---";
              option.value = "0";
              listbox.options[listbox.length] = option;
              <%for(int n=0;n<tList.size();n++){
                GSManufactureCategoryBean tGSManufactureBean = (GSManufactureCategoryBean)tList.get(n);
                String categoryId = tGSManufactureBean.getGs_manufacture_category_id();
                String categoryName = tGSManufactureBean.getGs_manufacture_category_name();%>
                var temp1 = '<%=categoryId%>';
                var temp2 = '<%=categoryName%>';
                var option = new Option();
                option.value = temp1;
                option.text = temp2;
                listbox.options[listbox.length] = option;
                <%}%>
              }
          <%
          }
          %>
          if(counter == '0'){
                var listbox = document.getElementById("manuftype3");
                listbox.length = 0;
                var option = new Option();
                option.text = "---三级---";
                option.value = "0";
                listbox.options[listbox.length] = option;          
          }
          <%
            }%>
          }
        }
        function openwin(value){
          showModalDialog("<%=response.encodeURL(root+"/jsp/showimage.jsp")%>?path="+value,window,"status:no;unadorned:yes;dialogWidth:375px;dialogHeight:400px;help:no;");
        }
     
    
    
    function printContract() {
        if(pager.orderDetailIds == null){
            return false;
        }
        if(!isCheckBoxselected(pager,pager.orderDetailIds)){
            alert("请至少选择一笔订单");
            return false;
        }  
        var addr = "";
        var param = new Array();
        var selectedCount = -1;
        var selectedDetailIds = document.pager.orderDetailIds;
        if(selectedDetailIds.length > 1) {
            
            
            for(i=0; i<selectedDetailIds.length;i++){
                if(!selectedDetailIds[i].checked)
                    continue;
                else {
                    selectedCount++;
                    param[selectedCount] = selectedDetailIds[i].value;
                }                    
                
                if(selectedCount==0) {
                    addr = document.pager.all("Address_"+selectedDetailIds[i].value).value;
                    continue;
                }
            
                if(document.pager.all("Address_"+selectedDetailIds[i].value).value != addr) {
                    alert("只有送货地址一样的订单才可以打印一张订货要约书上，请重新选择。");;
                    return false;
                }
            }
        } else {
            param[0] = selectedDetailIds.value;
        }
        
        window.open("<%=response.encodeURL(root+"/A150805.do?params=")%>"+param);
              
    }
    
    function exportContract() {
        if(pager.orderDetailIds == null){
            return false;
        }
        if(!isCheckBoxselected(pager,pager.orderDetailIds)){
            alert("请选择一笔订单");
            return false;
        }  
  
        var count=0;
        var selectedDetailIds = document.pager.orderDetailIds;
        var id='';
        if(document.pager.orderDetailIds.length > 1) {
            var selectedDetailIds = document.pager.orderDetailIds;
            for(i=0; i<selectedDetailIds.length;i++){
            if(selectedDetailIds[i].checked) {
           		 id=selectedDetailIds[i].value;
                count++;
            	}
            }
        } else {
            var selectedDetailIds = document.pager.orderDetailIds;
            if(selectedDetailIds.checked) {
           	 	id=selectedDetailIds.value;
        		 count++;
            } else {
                return false;
            }
        }
        if(count > 1) {
           alert("只能选择一条记录!");;
           return false; 
        } 
        window.open("<%=response.encodeURL(root+"/GSBusOrderDownServlet?params=")%>"+id);
              
    }
    
    
    function receiveOrder() {
        if(pager.orderDetailIds == null){
            return false;
        }
        if(!isCheckBoxselected(pager,pager.orderDetailIds)){
            alert("请至少选择一笔订单");
            return false;
        }
        var selectedIds = new Array();
        var count = 0;
        
        if(document.pager.orderDetailIds.length > 1) {
            var selectedDetailIds = document.pager.orderDetailIds;
            for(i=0; i<selectedDetailIds.length;i++){
               if(selectedDetailIds[i].checked) {
                    if(document.pager.all("Status_"+selectedDetailIds[i].value).value != "<%=GSBaseConstants.ORDER_ORDER_CONFIRM%>") {
                        alert("只有状态为\"已确认\"的订单才可以确认交货。");
                        return false;
                    } else {
                        selectedIds[count++] = selectedDetailIds[i].value;
                    }
                }
            }
        } else {
            var selectedDetailIds = document.pager.orderDetailIds;
            if(selectedDetailIds.checked) {
                if(document.pager.all("Status_"+selectedDetailIds.value).value != "<%=GSBaseConstants.ORDER_ORDER_CONFIRM%>") {
                        alert("只有状态为\"已确认\"的订单才可以确认交货。");
                        return false;
                } else {
                    selectedIds[0] = selectedDetailIds.value;
                }
            } else {
                return false;
            }
        }

        if(confirm("是否确定所选订单？")){                     
             var result = showModalDialog("<%=response.encodeURL(root+"/A150803.do?params=")%>"+selectedIds,window,"status:no;unadorned:yes;dialogWidth:700px;dialogHeight:650px;help:no;");
             if(result != null && result != undefined) {
                ordertraceform.appendChild(document.createElement("<input type='hidden' name='totalCount' value='"+result.length+"'>"));
                for(var i=0; i<result.length; i++) {
                    ordertraceform.appendChild(document.createElement("<input type='hidden' name='signOrderDetailId_"+i+"' value='"+result[i][0]+"'>"));
                    ordertraceform.appendChild(document.createElement("<input type='hidden' name='signQty_"+i+"' value='"+result[i][1]+"'>"));
                    ordertraceform.appendChild(document.createElement("<input type='hidden' name='signDate_"+i+"' value='"+result[i][2]+"'>"));
                    ordertraceform.appendChild(document.createElement("<input type='hidden' name='signPrice_"+i+"' value='"+result[i][3]+"'>"));
                }
                
                ordertraceform.action = "<%=response.encodeURL(root+"/A150804.do")%>";
                ordertraceform.submit();
             }
                         
        }
              
        
    }
    
    function rejectOrder() {
        if(pager.orderDetailIds == null){
            return false;
        }
        if(!isCheckBoxselected(pager,pager.orderDetailIds)){
            alert("请选择一笔订单");
            return false;
        }
        var selectedIds = new Array();
        var count = 0;
        var ids='';
        var num=0;
        if(document.pager.orderDetailIds.length > 1) {
            var selectedDetailIds = document.pager.orderDetailIds;
            for(i=0; i<selectedDetailIds.length;i++){
               if(selectedDetailIds[i].checked) {     
            	   		var statusNum=document.pager.all("Status3Num_"+selectedDetailIds[i].value).value;
            	   		num+=parseInt(statusNum);
            			ids+= selectedDetailIds[i].value+','
                        selectedIds[count++] = selectedDetailIds[i].value;
                }
            }
        } else {
            var selectedDetailIds = document.pager.orderDetailIds;
            if(selectedDetailIds.checked) {
        	   var statusNum=document.pager.all("Status3Num_"+selectedDetailIds.value).value;
    	   	   num+=parseInt(statusNum);
               selectedIds[0] = selectedDetailIds.value;
               ids=selectedIds[0]+',';
            } 
        }
        ids=ids.substring(0,ids.length-1);
        
        if(num==0) {
            alert("复审通过笔数为0,请重新选择!");;
            return false;
        }
        
        if(confirm("是否确定所选订单？")){                     
            var result = showModalDialog("<%=response.encodeURL(root+"/A150903.do?params=")%>"+ids,window,"status:no;unadorned:yes;dialogWidth:700px;dialogHeight:650px;help:no;");
            if(result != null && result != undefined) {
               ordertraceform.appendChild(document.createElement("<input type='hidden' name='totalCount' value='"+result.length+"'>"));
               for(var i=0; i<result.length; i++) {
                   ordertraceform.appendChild(document.createElement("<input type='hidden' name='signOrderDetailId_"+i+"' value='"+result[i][0]+"'>"));
                   ordertraceform.appendChild(document.createElement("<input type='hidden' name='signQty_"+i+"' value='"+result[i][1]+"'>"));
               }
               
               ordertraceform.action = "<%=response.encodeURL(root+"/A150904.do")%>";
               ordertraceform.submit();
            }
                        
       }
    }
    
    function confirmOrder() {
    	   if(pager.orderDetailIds == null){
               return false;
           }
           if(!isCheckBoxselected(pager,pager.orderDetailIds)){
               alert("请选择一笔订单");
               return false;
           }
           var selectedIds = new Array();
           var count = 0;
           var ids='';
           var num=0;
           if(document.pager.orderDetailIds.length > 1) {
               var selectedDetailIds = document.pager.orderDetailIds;
               for(i=0; i<selectedDetailIds.length;i++){
                  if(selectedDetailIds[i].checked) {     
               	   		var statusNum=document.pager.all("Status3Num_"+selectedDetailIds[i].value).value;
               	   		num+=parseInt(statusNum);
               			ids+= selectedDetailIds[i].value+','
                           selectedIds[count++] = selectedDetailIds[i].value;
                   }
               }
           } else {
               var selectedDetailIds = document.pager.orderDetailIds;
               if(selectedDetailIds.checked) {
           	   var statusNum=document.pager.all("Status3Num_"+selectedDetailIds.value).value;
       	   	   num+=parseInt(statusNum);
                  selectedIds[0] = selectedDetailIds.value;
                  ids=selectedIds[0]+',';
                  count++;
               } 
           }
           ids=ids.substring(0,ids.length-1);
           
           if(count > 1) {
               alert("只能选择一条记录!");;
               return false; 
            } 
           
           if(num==0) {
               alert("复审通过笔数为0,请重新选择!");;
               return false;
           }
           
           if(confirm("是否确定所选订单？")){                     
               var result = showModalDialog("<%=response.encodeURL(root+"/A150905.do?params=")%>"+ids,window,"status:no;unadorned:yes;dialogWidth:700px;dialogHeight:650px;help:no;");
            
               if(result != null && result != undefined) {
            	   if(!isString(result)){
            		   ordertraceform.appendChild(document.createElement("<input type='hidden' name='totalCount' value='"+result.length+"'>"));
                       for(var i=0; i<result.length; i++) {
                           ordertraceform.appendChild(document.createElement("<input type='hidden' name='signOrderDetailId_"+i+"' value='"+result[i][0]+"'>"));
                       }
                       ordertraceform.action = "<%=response.encodeURL(root+"/A150910.do")%>";
                       ordertraceform.submit();    
            	   }else{
            		   if(result=='true'){
                           window.location.reload();
                           return;  
                       }
            	   }         	   
               }
          }
    }
    
    function isString(str){
    	return typeof str=="string"||(str && (typeof str.substr=='function'));
    }
    
    function confirmGoods() {
    	 if(pager.orderDetailIds == null){
             return false;
         }
         if(!isCheckBoxselected(pager,pager.orderDetailIds)){
             alert("请选择一笔订单");
             return false;
         }
         var selectedIds = new Array();
         var count = 0;
         var ids='';
         var num=0;
         if(document.pager.orderDetailIds.length > 1) {
             var selectedDetailIds = document.pager.orderDetailIds;
             for(i=0; i<selectedDetailIds.length;i++){
                if(selectedDetailIds[i].checked) {     
             	   		var statusNum=document.pager.all("Status10Num_"+selectedDetailIds[i].value).value;
             	   		num+=parseInt(statusNum);
             			ids+= selectedDetailIds[i].value+','
                         selectedIds[count++] = selectedDetailIds[i].value;
                 }
             }
         } else {
             var selectedDetailIds = document.pager.orderDetailIds;
             if(selectedDetailIds.checked) {
         	   var statusNum=document.pager.all("Status10Num_"+selectedDetailIds.value).value;
     	   	   num+=parseInt(statusNum);
                selectedIds[0] = selectedDetailIds.value;
                ids=selectedIds[0]+',';
             } 
         }
         ids=ids.substring(0,ids.length-1);
         
         if(num==0) {
             alert("已确认笔数为0,请重新选择!");;
             return false;
         }
         
	      if(confirm("是否确定所选订单？")){                     
	             var result = showModalDialog("<%=response.encodeURL(root+"/A150906.do?params=")%>"+ids,window,"status:no;unadorned:yes;dialogWidth:1000px;dialogHeight:650px;help:no;");
	             if(result != null && result != undefined) {
	                ordertraceform.appendChild(document.createElement("<input type='hidden' name='totalCount' value='"+result.length+"'>"));
	                for(var i=0; i<result.length; i++) {
	                    ordertraceform.appendChild(document.createElement("<input type='hidden' name='signOrderDetailId_"+i+"' value='"+result[i][0]+"'>"));
	                    ordertraceform.appendChild(document.createElement("<input type='hidden' name='signQty_"+i+"' value='"+result[i][1]+"'>"));
	                    ordertraceform.appendChild(document.createElement("<input type='hidden' name='signDate_"+i+"' value='"+result[i][2]+"'>"));
	                    ordertraceform.appendChild(document.createElement("<input type='hidden' name='signPrice_"+i+"' value='"+result[i][3]+"'>"));
	                    ordertraceform.appendChild(document.createElement("<input type='hidden' name='remark_"+i+"' value='"+result[i][4]+"'>"));
	                    ordertraceform.appendChild(document.createElement("<input type='hidden' name='flag_"+i+"' value='"+result[i][5]+"'>"));
	                }
	                
	                ordertraceform.action = "<%=response.encodeURL(root+"/A150909.do")%>";
	                ordertraceform.submit();
	             }
	                         
	        }
    }
    
    function viewGoods() {
    	window.open("<%= response.encodeURL(request.getContextPath() + "/servlet/Srv?action_code=listOrderDetailSignIn") %>","","status:yes;unadorned:no;dialogWidth:900px;dialogHeight:600px;help:yes;");
    }
</script>
</head>
<body LEFTMARGIN="0" TOPMARGIN="0" MARGINWIDTH="0"
    MARGINHEIGHT="0">
<p><br>
</p>
<table width="98%" border="0" cellspacing="0" cellpadding="0"
    align="center">
    <tr>
        <td height="20">
        <table width="100%" border="0" cellspacing="0" cellpadding="1">
            <tr height="20">
                <td height="30" width="758" class="mtxt_black">订单处理</td>
            </tr>
        </table>
        </td>
    </tr>
    <tr>
        <td class="bg_line" height="2"></td>
    </tr>
</table>
<br>
<form name="ordertraceform" method="get">
<input type="hidden" name="proname" value="<%=sn %>">
<table width="98%" border="0" cellspacing="0" cellpadding="0"
    align="center"></table>
<table class="bg_table" id="Table1" cellspacing="1" cellpadding="0"
    style="PADDING-RIGHT:5px;PADDING-LEFT:5px" width="98%" align="center"
    border="0">
    <TR height="20">
        <TD class="bg_column" align="center">订单编号</TD>
        <TD align="left" class="bg_row_odd"><input type="text" name="orderid"
            value="<%=request.getParameter("orderid")==null? "":request.getParameter("orderid") %>">
        </TD>
        <TD class="bg_column" align="center">订单状态</TD>
        <TD class="bg_row_odd" align="left"><select name="orderDetailStatus">
        	<%       String tOrderDetailStatus = request.getParameter("orderDetailStatus");
        	if(tOrderDetailStatus == null){%>
           <option value="0000">未处理</option>
     	   <option value="1111">已完成</option>
        	<% }
        	else if(tOrderDetailStatus != null && tOrderDetailStatus.equals("0000")) {%>
     	   <option value="0000" selected>未处理</option>
     	   <option value="1111">已完成</option>
     	   <%}else{ %>
     	   <option value="0000">未处理</option>
     	   <option value="1111" selected>已完成</option>
     	   <%} %>
        </select></TD>
    </TR>
    <TR height="20">
        <TD class="bg_column" align="center">订货单位</TD>
        <TD class="bg_row_odd"><select name="orderDeptId">
            <option value="<%=LoginContext.get(new SrvContext(request,response)).getLoginWarehouseCode() %>">---全部---</option>
              <%
                            String tOrderDept = request.getParameter("orderDeptId")==null?"":request.getParameter("orderDeptId");
                            if(wareList != null && wareList.size() > 0 ){
                                    for(int i=0; i<wareList.size(); i++){
                                        GSWareHouseBean tmp=(GSWareHouseBean)wareList.get(i);
                                        if(tmp != null && tOrderDept.equals(tmp.getCode())){
                            %>
                                            <option value="<%=tmp.getCode()%>" selected>
                                            <%=tmp.getName()%></option>
                            <%                  
                                        }else{
                            %>
                                            <option value="<%=tmp.getCode()%>"><%=tmp.getName()%></option>
                            <%          
                                        }
                                    }
                                }
                        %>
        </select></TD>
        <TD class="bg_column" align="center">供应商</TD>
        <TD class="bg_row_odd" align="left">
        <%=sn %>
        <INPUT type="hidden"  NAME="providerName" value="<%=s%>"></TD>
    </TR>
        <%
        SimpleDateFormat bartDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        Date d = new Date();
        String strNow = String.valueOf(bartDateFormat.format(d));
        long l=(long)259200*(long)10000;
        Date d2 = new Date(System.currentTimeMillis()-l);
        String strMothAgo = String.valueOf(bartDateFormat.format(d2));
        %>   
    <TR height="20">
        <TD class="bg_column" align="center">创建时间</TD>
        <TD align="left" class="bg_row_odd" >
        
        <%=framework.custom.UIManager.generateDateInput("orderCreateDateStr",
							request.getParameter("orderCreateDateStr")==null?strMothAgo:request.getParameter("orderCreateDateStr"))%>
					
					至
		<%=framework.custom.UIManager.generateDateInput("orderCreateDateEnd",
							request.getParameter("orderCreateDateEnd")==null?strNow:request.getParameter("orderCreateDateEnd"))%>
					
        </TD>
        <TD class="bg_column" align="center">送货单号</TD>
        <TD align="left" class="bg_row_odd"><INPUT type="text"
            NAME="deliverGoodsId"
            value="<%=request.getParameter("deliverGoodsId")==null? "":request.getParameter("deliverGoodsId") %>"></TD>
    </TR>
    
     <TR height="20">
        <TD class="bg_column" align="center">订单明细状态</TD>
        <TD class="bg_row_odd" align="left" colspan="3"><select name="orderDetailStatusMx">
        	<%       String tOrderDetailStatusMx = request.getParameter("orderDetailStatusMx");
        	if(tOrderDetailStatusMx == null||"0".equals(tOrderDetailStatusMx)){%>
           <option value="0">全部</option>
     	   <option value="1">复审通过</option>
     	   <option value="2">已确认</option>
     	   <option value="3">已拒绝</option>
     	   <option value="4">交货确认</option>
        	<% }
        	else if(tOrderDetailStatusMx != null && tOrderDetailStatusMx.equals("1")) {%>
                <option value="0">全部</option>
     	   <option value="1" selected>复审通过</option>
     	   <option value="2">已确认</option>
     	   <option value="3">已拒绝</option>
     	   <option value="4">交货确认</option>
     	   <%}else if(tOrderDetailStatusMx != null && tOrderDetailStatusMx.equals("2")) { %>
           <option value="0">全部</option>
     	   <option value="1">复审通过</option>
     	   <option value="2" selected>已确认</option>
     	   <option value="3">已拒绝</option>
     	   <option value="4">交货确认</option>
     	   <%}else if(tOrderDetailStatusMx != null && tOrderDetailStatusMx.equals("3")) { %>
     	   <option value="0">全部</option>
     	   <option value="1">复审通过</option>
     	   <option value="2">已确认</option>
     	   <option value="3" selected>已拒绝</option>
     	   <option value="4">交货确认</option>
     	   <%}else if(tOrderDetailStatusMx != null && tOrderDetailStatusMx.equals("4")) { %>
     	   <option value="0">全部</option>
     	   <option value="1">复审通过</option>
     	   <option value="2">已确认</option>
     	   <option value="3">已拒绝</option>
     	   <option value="4" selected>交货确认</option>
           <%}%>
        </select></TD>
    </TR>
</table>
<%
if(tOrder != null) {
    int totalRecords = 0;
    if(request.getAttribute("totalRecords")!=null){
        totalRecords=Integer.parseInt((String)request.getAttribute("totalRecords"));
    }
    int defaultPageSize =10;
    if(request.getAttribute("pageSize")!=null){
        defaultPageSize=Integer.parseInt((String)request.getAttribute("pageSize"));
    }
%>          
<page:pager total='<%=totalRecords%>' defaultPageSize='<%=defaultPageSize%>'></page:pager>
<%} %>
</form>
<p align="center">

        <input type="button" name="查询" value="查询" class="kuang" onclick="process('Q')"/>&nbsp;
        <input type="button" name="清空" value="清空" class="kuang" onclick="process('C')"/>&nbsp;
</p>
<br>
<%
        if (tOrder != null) {
%>
<table width="98%" border="0" cellspacing="0" cellpadding="0"
    align="center">
    <tr>
        <td>
        <%
            tList = tOrder.getAllRecoreds();            
        %> 
            <form name='pager' method="post">
            <table class=bg_table id=tableId cellspacing=1 cellpadding=2
                width=100% align=center border=0>
                <tbody>
                    <tr class="bg_column" height="20">
                        <td class="top" align="center" colSpan="21"><b>订单信息列表</b></td>
                    </tr>
                    <tr class="bg_column" height="20">
                        <td align=middle class=top>
                        <div class="txt_content">全选<br><input type="checkbox" name="indexs" onClick="SelectAllCheckBox(pager,'orderDetailIds')"></div>
                        </td>                     
                        <td class="top" align="center">
                        <div class="txt_content" align="center">订单编号</div>
                        </td>
                           <td class="top" align="center">
                        <div class="txt_content" align="center">订货单位</div>
                        </td>
                          <td class="top" align="center">
                        <div class="txt_content" align="center">订单状态</div>
                        </td>
                        <td class="top" align="center">
                        <div class="txt_content" align="center">订单明细笔数</div>
                        </td>
                        <td class="top" align="center">
                        <div class="txt_content" align="center">复审通过笔数</div>
                        </td>
                        <td class="top" align="center">
                        <div class="txt_content" align="center">已确认笔数</div>
                        </td>
                        <td class="top" align="center">
                        <div class="txt_content" align="center">已拒绝笔数</div>
                        </td>
                        <td class="top" align="center">
                        <div class="txt_content" align="center">交货确认笔数</div>
                        </td>
                        <td class="top" align="center">
                        <div class="txt_content" align="center">订货总数量</div>
                        </td>
                        <td class="top" align="center">
                        <div class="txt_content" align="center">签收总数量</div>
                        </td>
                  
                        <td class="top" align="center">
                        <div class="txt_content" align="center">订货地址</div>
                        </td>
                        <td class="top" align="center">
                        <div class="txt_content" align="center">订货联系人</div>
                        </td>
                        <td class="top" align="center">
                        <div class="txt_content" align="center">订单联系电话</div>
                        </td>
                        <td class="top" align="center">
                        <div class="txt_content" align="center">详细</div>
                        </td>
                    </tr>
        <%
            if (tList != null && tList.size() > 0) {
                for (int i = 0; i < tList.size(); i++) {
                	GSOrderAnaDetailAndCategoryNewBean tGSOrderVO = (GSOrderAnaDetailAndCategoryNewBean) tList.get(i);
                	int num=orderDao.getCountsByOrderStatus(tGSOrderVO.getGs_order_tempid_order(),"3");
                	int num2=orderDao.getCountsByOrderStatus(tGSOrderVO.getGs_order_tempid_order(),"10");
                    String tTempStr = "";
                    if (i % 2 == 0) {
                        tTempStr = "class=\"bg_row_odd\"";
                    } else {
                        tTempStr = "class=\"bg_row_even\"";
                    }
                    int size = 0;
        %>
                    <tr <%=tTempStr%> height=20>
                        <td class=top>                              
                          <div align="center" class="txt_content">
                           <input type="checkbox" id="orderDetailIds<%=i%>" name="orderDetailIds" value="<%=tGSOrderVO.getGs_order_tempid_order()%>">   
                           <input type="hidden" name="Status_<%=tGSOrderVO.getGs_order_tempid_order()%>" value="<%=tGSOrderVO.getGs_order_detail_status()%>"> 
                           <input type="hidden" name="Address_<%=tGSOrderVO.getGs_order_tempid_order()%>" value="<%=tGSOrderVO.getAddress_warehouse()%>">                                                                                                                                                                      
                           <input type="hidden" name="Status3Num_<%=tGSOrderVO.getGs_order_tempid_order()%>" value="<%=num %>">    
                           <input type="hidden" name="Status10Num_<%=tGSOrderVO.getGs_order_tempid_order()%>" value="<%=num2 %>">                             
                          </div>
                        </td> 
                        <td class="top" align="center">
                        <div class="txt_content" align="center"><%=tGSOrderVO.getGs_order_tempid_order()%></div>
                        </td>
                        <td class="top" align="center">
                        <div class="txt_content" align="center"><%=tGSOrderVO.getFull_name_warehouse()%></div>
                        </td>
                           <td class="top" align="center">
                        <div class="txt_content" align="center"><%=tOrderDetailStatus.equals("0000")?"未处理":"已完成"%></div>
                        </td>
                        <td class="top" align="center">
                        <div class="txt_content" align="center"><%=tGSOrderVO.getGs_order_detail_id()%>
                        </div>
                        </td>
                        <td class="top" align="center">
                        <div class="txt_content" align="center"><%=num%>
                        </div>
                        </td>
                        <td class="top" align="center">
        				<div class="txt_content" align="center"><%=num2%>
                        </div>
                        </td>
                        <td class="top" align="center">
               		    <div class="txt_content" align="center"><%=orderDao.getCountsByOrderStatus(tGSOrderVO.getGs_order_tempid_order(),"11")%>
                        </div>
                        </td>
                        <td class="top" align="center">
                        <div class="txt_content" align="center"><%=orderDao.getCountsByOrderStatus(tGSOrderVO.getGs_order_tempid_order(),"12")%>
                        </div>
                        </td>
                        <td class="top" align="center">
                        <div class="txt_content" align="center"><%=tGSOrderVO.getGs_order_count()%></div>
                        </td>
                        <td class="top" align="center">
                        <div class="txt_content" align="center"><%=tGSOrderVO.getGs_signin_count()%></div>
                        </td>
                        
                        <td class="top" align="center">
                        <div class="txt_content" align="center"><%=tGSOrderVO.getGs_deliver_goods_addr()%></div>
                        </td>
                               <td class="top" align="center">
                        <div class="txt_content" align="center"><%=tGSOrderVO.getGs_order_contact_name()%></div>
                        </td>
                        <td class="top" align="center">
                        <div class="txt_content" align="center"><%=tGSOrderVO.getGs_order_contact_phone()%></div>
                        </td>
                        <td class="top" align="center">
                        <div class="txt_content" align="center"><a
                            href="<%=response.encodeURL(root+"/A150911.do")%>?orderId=<%=tGSOrderVO.getGs_order_tempid_order()%>"
                            target="_blank">详细</A></div>
                        </td>
                    </tr>
                    <%
                }

            %>
                    <tr class="bg_column" height=20>
                        <td width="960" height="16" colspan="21" align="right"><!--导航条-->
                        <page:navigator type='text' queryForm='ordertraceform'/></td>
                    </tr>
                    <%} else {

            %>
                    <tr class="bg_column" height=20>
                        <td width="960" height="16" colspan="21" align="right">
                        <font color="red">没有符合条件的产品订单信息</font></td>
                    </tr>
                    
                    <%}

        %>
                </tbody>
            </table>
        </form></td>
    </tr>
</table>
    <p align="center">
        <input type="button" class="kuang" value="订单确认" onClick="confirmOrder()">
        <input type="button" class="kuang" value="导出订货要约书" onClick="exportContract()">
        <input type="button" class="kuang" value="交货确认" onClick="confirmGoods()">
        <input type="button" class="kuang" value="查看签收数据" onClick="viewGoods()">
    <!--  
        <input type="button" class="kuang" value="打印订货要约书" onClick="printContract()">
        <input type="button" class="kuang" value="交货确认" onClick="receiveOrder()">
    --></p>    
<%}
%>
</body>
</html>
